From 9d401b35f071a91e7281fcdd4a5ceba0dc125ba4 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 23 Nov 2005 11:15:18 +0100 Subject: [PATCH] Add -Wdeclaration-after-statement to CFLAGS only if the compiler supports it. Move test-gcc-flag function to Config.mk where it can be used by any component of the build. Signed-off-by: Keir Fraser --- Config.mk | 6 ++++-- xen/Rules.mk | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Config.mk b/Config.mk index b537fa5d4b..4a85a103ed 100644 --- a/Config.mk +++ b/Config.mk @@ -8,7 +8,6 @@ XEN_TARGET_X86_PAE ?= n # Tools to run on system hosting the build HOSTCC = gcc HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer -HOSTCFLAGS += -Wdeclaration-after-statement AS = $(CROSS_COMPILE)as LD = $(CROSS_COMPILE)ld @@ -39,7 +38,10 @@ EXTRA_INCLUDES += $(EXTRA_PREFIX)/include EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBDIR) endif -CFLAGS += -Wdeclaration-after-statement +test-gcc-flag = $(shell $(CC) -v --help 2>&1 | grep -q " $(1) " && echo $(1)) + +HOSTCFLAGS += $(call test-gcc-flag,-Wdeclaration-after-statement) +CFLAGS += $(call test-gcc-flag,-Wdeclaration-after-statement) LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i)) diff --git a/xen/Rules.mk b/xen/Rules.mk index 0f43b4efa9..f9721f03a2 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -43,8 +43,6 @@ CFLAGS += -DACM_SECURITY endif ALL_OBJS += $(BASEDIR)/arch/$(TARGET_ARCH)/arch.o -test-gcc-flag = $(shell $(CC) -v --help 2>&1 | grep -q " $(1) " && echo $(1)) - include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk ifneq ($(debug),y) -- 2.30.2